using System;

namespace PTP.Usb
{
  /// <summary>
  /// Defines what kind of device definition is used in USB for PTP device.
  /// Source:
  /// http://www.usb.org/developers/devclass_docs/usb_still_img10.pdf,
  /// Chapter 4 "Device Characteristics" 
  /// </summary>
  public static class InterfaceInfo
  {
    /// <summary>
    /// Test if interface matches PTP device characteristics 
    /// </summary>
    /// <param name="classCode">Class code</param>
    /// <param name="subclassCode">Sub-class code</param>
    /// <param name="protocolCode">Protocol code</param>
    /// <returns></returns>
    public static bool IsPTPInterface(int classCode, int subclassCode, int protocolCode)
    {
      return (classCode == 6) && // Image class
            (subclassCode == 1) && // Still image capture device
            (protocolCode == 1); //1.0 class specification
    }
  }
}
